This key represents a sort option for a Collection.
Appears in
└── collections_config
└── *
└── sort_options
└── [*]Type
Object
Properties
This key defines which key an option in the Sort dropdown should use to sort files in your Collection browser.
You must define this key for every entry in the sort_options array for the object to function.
Value must be the name of a structured data key in your Collection files.
If some files in your Collection do not have this data key, CloudCannon will sort those in ascending alphabetical order, after the file sorted by your data key in the Collection browser.
Appears in: sort_options[*].
Show examplesHide examples
In this example, the "Author (A-Z)" option in the Sort dropdown will use the author key to sort files in the blog Collection browser.
collections_config:
blog:
sort_options:
- key: author
order: ascending
label: Author (A-Z){
"collections_config": {
"blog": {
"sort_options": [
{
"key": "author",
"order": "ascending",
"label": "Author (A-Z)"
}
]
}
}
}This key defines the label used for a file sorting option in the Sort dropdown.
Appears in: sort_options[*].
Show examplesHide examples
In this example, the sorting method which uses the author key is called "Author (A-Z)" in the Sort dropdown.
collections_config:
blog:
sort_options:
- key: author
order: ascending
label: Author (A-Z){
"collections_config": {
"blog": {
"sort_options": [
{
"key": "author",
"order": "ascending",
"label": "Author (A-Z)"
}
]
}
}
}This key defines which order an option in the Sort dropdown should use to sort files in your Collection browser.
CloudCannon will sort files according to the value of sort_options[*].key for each option in the Sort dropdown.
Defaults to: ascending
Allowed values: ascending descending asc desc
Appears in: sort_options[*].
Show examplesHide examples
In this example, the "Author (A-Z)" option in the Sort dropdown will sort files in the blog Collection browser in ascending order.
collections_config:
blog:
sort_options:
- key: author
order: ascending
label: Author (A-Z){
"collections_config": {
"blog": {
"sort_options": [
{
"key": "author",
"order": "ascending",
"label": "Author (A-Z)"
}
]
}
}
}